home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / misc / amag / sh9301c.lha / Windows(S.106) / Listing5.txt < prev    next >
Text File  |  1992-11-20  |  1KB  |  56 lines

  1. for(;;)  /* Message-Loop */
  2.    {
  3.      Wait(1L << Window->UserPort->mp_SigBit);
  4.  
  5.      while( msg = GetMsg(Window->UserPort) )
  6.      {
  7.        class = msg->Class;
  8.        code  = msg->Code;
  9.        ReplyMsg( msg );
  10.  
  11.        switch( class)
  12.        {
  13.           case CLOSEWINDOW:
  14.                close_all();
  15.                break;
  16.  
  17.           case MENUPICK:
  18.                if (MENUNUM(code) != MENUNULL)
  19.                  do_menu();
  20.                 break;
  21.        }
  22.      }
  23.    }
  24.  
  25.  
  26. void do_menu()
  27. {
  28.   switch(MENUNUM(code)) /* Switch Titel */
  29.     {
  30.      case  IDM_DATEI:
  31.            switch(ITEMNUM(code))
  32.            {
  33.               case IDM_D_NEU:
  34.                    Do_Neu();
  35.                    break;
  36.               case IDM_D_OEFFNEN:
  37.                    Do_Oeffnen();
  38.                    break;
  39.            }
  40.            break;
  41.  
  42.      case  IDM_BEARBEITEN:
  43.            switch(ITEMNUM(code))
  44.            {
  45.               case  IDM_B_UNDO:
  46.                     do_Undo();
  47.                     break;
  48.               case  IDM_B_COPY:
  49.                     do_Copy();
  50.                     break;
  51.            }
  52.            break;
  53.  
  54.     }
  55. }
  56.